package com.vv.vv_commonlibrary.dialog;


import android.content.Context;
import android.view.View;

import com.vv.vv_commonlibrary.R;

/**
 * @author Administrator
 */
public class MessageConfirmDialog {

    /**
     * 删除信息的操作
     */
    public static int DeleteMessageById = 0;

    /**
     * 删除信息的操作
     */
    public static int ReadAllMessage = 1;

    public void showDialog(Context context, final OnConfirmListener onConfirmListener, final int conFirmType, String tips) {
        showDialog(context, onConfirmListener, conFirmType, tips, context.getString(R.string.reminder));
    }

    public void showDialog(Context context, final OnConfirmListener onConfirmListener, final int conFirmType, String tips, String title) {

        new CenterDialog.Builder(context)
                .setTitle(title)
                .setMessage(tips)
                .setCancel(context.getString(R.string.cancel_txt))
                .setConfrim(context.getString(R.string.confirm_txt), new CenterDialog.Builder.OnBtnClickListener() {
                    @Override
                    public void onCancel(View v) {

                    }

                    @Override
                    public void onConfirm(View v) {
                        onConfirmListener.onConfirm(conFirmType);
                    }
                }).builder().show();
    }


    public interface OnConfirmListener {

        /**
         * 点击确认后的回调
         *
         * @param conFirmType 用于判断做什么操作，如删除，全部已读
         */
        void onConfirm(int conFirmType);
    }


}
